package com.google.android.gms.internal;

import java.io.IOException;

public final class zzjx extends zzflm<zzjx> {
    private Integer zzbew = null;
    private zzjy zzbgo = null;
    private zzju zzbgp = null;

    public zzjx() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    /* access modifiers changed from: private */
    /* renamed from: zzu */
    public final zzjx zza(zzflj zzflj) throws IOException {
        zzfls zzfls;
        while (true) {
            int zzcxx = zzflj.zzcxx();
            if (zzcxx == 0) {
                return this;
            }
            if (zzcxx != 8) {
                if (zzcxx == 18) {
                    if (this.zzbgo == null) {
                        this.zzbgo = new zzjy();
                    }
                    zzfls = this.zzbgo;
                } else if (zzcxx == 26) {
                    if (this.zzbgp == null) {
                        this.zzbgp = new zzju();
                    }
                    zzfls = this.zzbgp;
                } else if (!super.zza(zzflj, zzcxx)) {
                    return this;
                }
                zzflj.zza(zzfls);
            } else {
                int position = zzflj.getPosition();
                try {
                    this.zzbew = Integer.valueOf(zzjc.zzd(zzflj.zzcym()));
                } catch (IllegalArgumentException unused) {
                    zzflj.zzmw(position);
                    zza(zzflj, zzcxx);
                }
            }
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzbew != null) {
            zzflk.zzad(1, this.zzbew.intValue());
        }
        if (this.zzbgo != null) {
            zzflk.zza(2, (zzfls) this.zzbgo);
        }
        if (this.zzbgp != null) {
            zzflk.zza(3, (zzfls) this.zzbgp);
        }
        super.zza(zzflk);
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzbew != null) {
            zzq += zzflk.zzag(1, this.zzbew.intValue());
        }
        if (this.zzbgo != null) {
            zzq += zzflk.zzb(2, (zzfls) this.zzbgo);
        }
        return this.zzbgp != null ? zzq + zzflk.zzb(3, (zzfls) this.zzbgp) : zzq;
    }
}
